package javase.chixing.thread_synchronized;

//通过继承父类 Thread 来实现对应的线程方法
class ThreadA extends Thread{
    private Thread thread;

    public ThreadA(Thread thread) {
        this.thread = thread;
    }

    public ThreadA() {
    }

    @Override
    public void run() {
        System.out.println("线程A正在执行...");
        //获取30以内的奇数
        for (int i = 1; i <= 30; i+=2) {
            if (i == 1) {
                try {
                    thread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("threadA>>>"+i);
        }
    }
}
